<template>
  <div>
    <van-nav-bar title="通知详情" left-text="返回" left-arrow @click-left="() => $router.go(-1)" />
    <div style="padding:10px 20px">
      <div class="title">{{ this.detail.title }}</div>
      <div class="basicInfo">
        <div>作者:{{ this.detail.author }}</div>
        <div>浏览量:{{ this.detail.browse }}</div>
        <div>发布时间:{{ this.detail.time.slice(0, 10) }}</div>
      </div>
      <div class="text">
        {{ this.detail.content }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      detail: { title: '', author: '', time: '', content: '' }
    }
  },
  created() {
    let noticeID = this.$route.query.noticeID
    console.log('id', noticeID);
    this.$axios.post(`/getNotice?noticeID=${noticeID}`).then((res) => {
      // this.$set(this.noticeList,0,res.data)
      this.detail = res.data[0]
      console.log('res', res.data[0]);

      console.log('detail', this.detail);

    });
  }
}
</script>

<style scoped>
.title {
  font-size: 16px;
  font-weight: bold;
  margin: 10px 0px;
}

.basicInfo {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
}

.basicInfo div {
  font-size: 10px;
}

.text {
  text-indent: 2em;
  text-align: left;
  white-space: pre-wrap;
  text-indent: 2em;
}
</style>